package com.funwell.server.constants;

/**
 * @author sunfangwei
 */
public class Constants {
	/*
	 * 和公众号对应的唯一识别码
	
	public static final String PLAN_CODE_KEY = ""; */
	/**
	 * 默认的访问Token的HTTP请求头的名字
	 */
	public static final String ACCESS_TOKEN_HEADER_NAME = "X-Access-Auth-Token";

	/**
	 * 支付宝用户USERID的HTTP请求头的名字
	 */
	public static final String ALIPAY_USER_ID_HEADER_NAME = "Yd_Alipay_User_Id";

	/**
	 * 缓存用户的key,USER_; USER_1
	 */
	public static final String SERVER_USER_KEY = "USER_";

	/**
	 * 用户过期时间(单位:秒，1天)
	 */
	public static final int SERVER_USER_EXP_KEY = 60 * 60 * 24 * 1;

	/**
	 * 端来源-请求头key
	 */
	public static final String REQUEST_SIDE_HEAD_NAME = "X-REQUEST-SIDE";

	/**
	 * 系统参数缓存前缀
	 */
	public static final String CACHE_GLOBAL_CONFIG_PREFIX = "CACHE_GLOBAL_CONFIG_";
	/**
	 * 系统参数缓存数据 7天
	 */
	public static final int CACHE_GLOBAL_CONFIG_SECOND = 86400 * 7;

	/**
	 * 周榜缓存7天
	 */
	public static final int WEEK_RANK_EXPIRE_TIME = 86400 * 7;

	public enum Status {

		NORMAL(1, "正常"), FROZEN(2, "禁用");
		public int code;
		public String label;

		private Status(int code, String label) {
			this.code = code;
			this.label = label;
		}

		public static boolean isNormal(Integer status) {
			if (status != null && status.intValue() == NORMAL.code) {
				return true;
			}
			return false;
		}
	}

	public enum MobileCaptchaType {
		REGISTER(1, "注册"), CHANGE_PWD(2, "更改密码"), FIND_PWD(3, "找回密码"), LOGIN(4, "登录"), AUTH(5, "车位锁授权"), UNAUTH(6,
				"车位锁取消授权");
		public int code;
		public String desc;

		private MobileCaptchaType(int code, String desc) {
			this.code = code;
			this.desc = desc;
		}

		public static MobileCaptchaType getTypeById(Integer code) {
			switch (code) {
			case 1:
				return REGISTER;
			case 2:
				return CHANGE_PWD;
			case 3:
				return FIND_PWD;
			case 4:
				return LOGIN;
			default:
				return null;
			}
		}
	}

	public enum UserType {
		INDIVIDUAL(1, "普通用户"), PARTNER(2, "内部用户");
		public int code;
		public String label;

		private UserType(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	public enum Operatetype {
		APPLYCARD(1, "办卡"), RENEW(2, "续费"),REPAIRCARD(3, "补卡"), ASSIGNMENT(4, "转让"),CARDUPGRADE(5, "卡升级"), EXTENSION(6, "延期");
		public Integer code;
		public String label;

		private Operatetype(Integer code, String label) {
			this.code = code;
			this.label = label;
		}
	}
	
	public enum Membertype {
		PERSON(1, "个人用户"), TEAM(2, "团队用户");
		public int code;
		public String label;

		private Membertype(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	public enum CommentStatus {

		UNCOMMENt(1, "未评价"), COMMENTED(2, "已评价");
		public int code;
		public String label;

		private CommentStatus(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	public enum DefaultAddressStatus {

		UNDEFAULT(1, "备选地址"), DEFAULT(2, "默认地址");
		public int code;
		public String label;

		private DefaultAddressStatus(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	public enum ProductType {

		ACTIVITY(1, "年卡"), COURSE(2, "课程");
		public int code;
		public String label;

		private ProductType(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	// (1:APP，2:微信，3:支付宝)
	public enum LoginPlatform {
		APP(1, "APP"), WEIXIN(2, "微信"), ALIPAY(3, "支付宝");
		public int code;
		public String label;

		private LoginPlatform(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	/**
	 * 分销商协议性质
	 * 
	 * @author fangpengli@uworks.cc
	 *
	 */
	public enum ProtocolProperty {
		WAREHOUSE(1, "仓库"), DISECTSALE(2, "直营");
		public int code;
		public String label;

		private ProtocolProperty(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

	/**
	 * 分销级别
	 * 
	 * @author fangpengli@uworks.cc
	 *
	 */
	public enum DistributionLevel {
		ONELEVEL(1, "一级"), TWOLEVEL(2, "二级");
		public int code;
		public String label;

		private DistributionLevel(int code, String label) {
			this.code = code;
			this.label = label;
		}
	}

}
